var _o48;
var cc__decorate = __decorate;
Object.defineProperty(exports, "__esModule", {
  value: true
});
var $2ServerConfig = require("ServerConfig");
var cc__decorator = cc._decorator;
var ccp_ccclass = cc__decorator.ccclass;
var ccp_property = cc__decorator.property;
var def_ImagManager = _o48 = /* */function () {
  function _ctor() {
    babel_classCallCheck(this, _ctor);
    this.index = 0;
    this.inited = false;
    this.textures = new Map();
  }
  return babel_createClass(_ctor, [{
    key: "init",
    value: function init() {
      if (this.inited) {
        return;
      }
      var e = $2ServerConfig.default.getInstance().topapp.applist;
      if (!(e.length <= 0)) {
        this.load(0, e);
        this.inited = true;
      }
    }
  }, {
    key: "load",
    value: function load(e, t) {
      var _this44 = this;
      if (t[e]) {
        var _n19 = t[e].icon;
        cc.loader.load(_n19, function (_o49, i) {
          _this44.textures.set(_n19, i);
          _this44.load(++e, t);
        });
      }
    }
  }, {
    key: "getImage",
    value: function getImage(e) {
      if (this.textures.has(e)) {
        return this.textures.get(e);
      } else {
        return null;
      }
    }
  }], [{
    key: "getInstance",
    value: function getInstance() {
      null == this._instacne && (this._instacne = new _o48());
      return this._instacne;
    }
  }]);
}();
def_ImagManager._instacne = null;
def_ImagManager = _o48 = cc__decorate([ccp_ccclass], def_ImagManager);
exports.default = def_ImagManager;